#include<stdio.h>
#include<string.h>

//typedef 关键字用来给任意数据类型 取别名的，主要用于结构体
//比如typedef int MYINT; MYINT和int一模一样

typedef struct Books{
    char author[50];
    char subject[50];
    int book_id;
}Book;
//Book就等同于struct Books


int main(){
    Book book;//等同于struct Books book;也和c++的类申明一个对象一样
    book.book_id = 100;
    strcpy(book.author, "allen");

    printf("book author = %s, book_id = %d\n", book.author, book.book_id);

    //typedef VS define
    //typedef只是为类型定义别名，define不仅给类型定义别名，还可以给数值定义别名，比如：#define ONE 1;
}